#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include "head.h"
#include <QMainWindow>

QT_BEGIN_NAMESPACE
namespace Ui
{
    class MainWindow;
}
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT
public slots:
    void dorweMessageList_item_click(QListWidgetItem *item);
signals:
    void emitShowWindow(); // 定义槽函数
public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();
    // 绘制侧边栏
    QLabel *myHeadImg;
    void dorweSideBar();
    void updateSideBar();
    // 绘制消息列表
    void dorweMessageList_search();
    void dorweMessageList_Box();
    void dorweMessageList_item(int i, QListWidget *listWidget);
    void dorweMessageList();
    QListWidget *listWidget;
    void MessageListUpdate();
    // 绘制聊天窗口
    void ChatWindowUpdate();
    void dorweChatWindow();
    void dorweChatWindow_title();
    void dorweChatWindow_window();
    
    void dorweChatWindow_tool();
    void dorweChatWindow_input();
    void dorweChatWindow_sendBtn();
    // 鼠标相关
    void mousePressEvent(QMouseEvent *event);   // 移动
    void mouseMoveEvent(QMouseEvent *event);    // 松开
    void mouseReleaseEvent(QMouseEvent *event); // 双击
    void mouseDoubleClickEvent(QMouseEvent *event);
    void enterEvent(QEvent *event);
    void leaveEvent(QEvent *event);
    // 聊天窗口标题
    QLabel *ChatWindow_titleLable;
    QString chatWindow_title = "";
    // 聊天工具模块
    QLabel *MessageList_Search;
    // 聊天内容滚动区域
    QScrollArea *scrollArea;
    QWidget *contentWidget;
    QVBoxLayout *layout;
    // 聊天内容输入框
    QTextEdit *textEdit;
    // 发送按钮
    QPushButton *sendBtn;
signals:
    void toGamesPageFn();

private:
    Ui::MainWindow *ui;
};
#endif // MAINWINDOW_H
